//
//  CustomDefine.h
//  小宝爱学
//
//  Created by imac on 15-8-6.
//  Copyright (c) 2015年 imac. All rights reserved.
//

#ifndef _____CustomDefine_h
#define _____CustomDefine_h


#endif

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, PageType){
    PageTypeOfCollection,
    PageTypeOfAudition,
    PageTypeOfemption,
    
};

//随机色
#define ZMJRandomColor [UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:0.4]



//系统版本兼容
#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)



#ifdef DEBUG        //调试状态打开LOG功能
#define NSLog(...) NSLog(__VA_ARGS__)
#else               //发布状态关闭LOG功能
#define NSLog(...)
#endif



#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>





    #import "CBGRequsetServers.h"
    #import "SXLoadingView.h"
    #import "CHHLoadingView.h"

    //#import "UIView+CBLoadingView.h"
    //#import "UIView+Extension.h"
    //#import "UIImage+Image.h"
    //#import "UIBarButtonItem+Extension.h"
#endif



#define ZMJImage(imageName) [UIImage imageNamed:(imageName)]





//resource path
#define __kWidth [[UIScreen mainScreen]bounds].size.width
#define __kHeight [[UIScreen mainScreen]bounds].size.height
#define CGRectOrigin(v)    v.frame.origin
#define CGRectSize(v)      v.frame.size
#define CGRectX(v)         CGRectOrigin(v).x
#define CGRectY(v)         CGRectOrigin(v).y
#define CGRectW(v)         CGRectSize(v).width
#define CGRectH(v)         CGRectSize(v).height


// 取系统版本，e.g.  4.0 5.0
#define kSystemVersion [[[UIDevice currentDevice] systemVersion]  floatValue]
#define IOS7 kSystemVersion>7.0
#define MyAppDelegate (AppDelegate *)[[UIApplication sharedApplication] delegate]
#define IsNilString(__String) (__String==nil || [__String isEqualToString:@""]|| [__String isEqualToString:@"null"])
#define MFont(font)   [UIFont systemFontOfSize:(font)]

#define loadingTime 1.5

#define IsNull(__Text) [__Text isKindOfClass:[NSNull class]]
#define IsEquallString(_Str1,_Str2)  [_Str1 isEqualToString:_Str2]


//16进制color 使用方法：HEXCOLOR(0xffffff)
#define HEXCOLOR(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//button
# define BtnNormal            UIControlStateNormal
# define BtnTouchUpInside     UIControlEventTouchUpInside


#define RootURL @"http://lib1234.6655.la/API/"
#define RootWebsite @"http://x171998110.oicp.net"

